package org.springframework.Demo9;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

@Component
@Configuration(proxyBeanMethods = true)
public class Config9 {

	@Bean
	public UserService userService(){
		System.out.println("获取 UserService  对象");
		UserService userService=new UserService();
		return userService;
	}

	@Bean
	public StudentService studentService(){
		UserService userService = userService();
		StudentService studentService=new StudentService(userService);
		return studentService;
	}

}
